using System.ComponentModel.DataAnnotations;
using Terra.Core.Common.Enums.Identity;

namespace Terra.Service.Identity.DTOs;

/// <summary>
/// 密码检查结果
/// </summary>
public class PwdResetDtos
{
    /// <summary>
    /// 是否需要重置
    /// </summary>
    public bool NeedReset { get; set; }

    /// <summary>
    /// 重置类型
    /// </summary>
    public PasswordResetType ResetType { get; set; }

    /// <summary>
    /// 提示信息
    /// </summary>
    public string Message { get; set; }
}


/// <summary>
/// 密码验证结果
/// </summary>
public class PasswordValidationResult
{
    /// <summary>
    /// 是否有效
    /// </summary>
    public bool IsValid { get; set; }

    /// <summary>
    /// 验证消息
    /// </summary>
    public string Message { get; set; }
}


public class InitiatePasswordResetRequestDto
{
    /// <summary>
    /// 账号(邮箱/手机)
    /// </summary>
    [Required(ErrorMessage = "账号不能为空")]
    public string Account { get; set; }

    /// <summary>
    /// 重置方式(邮件/短信)
    /// </summary>
    [Required(ErrorMessage = "重置方式不能为空")]
    public ResetType ResetType { get; set; }
}

public class ValidatePasswordResetRequestDto
{
    /// <summary>
    /// 验证token/验证码
    /// </summary>
    [Required(ErrorMessage = "验证码不能为空")]
    public string Token { get; set; }

    /// <summary>
    /// 新密码
    /// </summary>
    [Required(ErrorMessage = "新密码不能为空")]
    public string NewPassword { get; set; }

    /// <summary>
    /// 重置方式
    /// </summary>
    [Required(ErrorMessage = "重置方式不能为空")]
    public ResetType ResetType { get; set; }
}

public class ResetInitialPasswordRequestDto
{
    /// <summary>
    /// 当前密码
    /// </summary>
    [Required(ErrorMessage = "当前密码不能为空")]
    public string CurrentPassword { get; set; }

    /// <summary>
    /// 新密码
    /// </summary>
    [Required(ErrorMessage = "新密码不能为空")]
    public string NewPassword { get; set; }
}